Skip to content

Check ADS for zone identifier before trying to load a dll plugin.#3646

Open
EosBandi wants to merge 1 commit into
ArduPilot:masterfrom
EosBandi:plugin-dll-check
Open

Check ADS for zone identifier before trying to load a dll plugin.#3646
EosBandi wants to merge 1 commit into
ArduPilot:masterfrom
EosBandi:plugin-dll-check

Conversation

@EosBandi
Copy link
Copy Markdown
Collaborator

Detect and report blocked plugin DLLs on Windows

On Windows 10 and 11, DLLs downloaded from the internet are marked as unsafe via a Zone Identifier (stored as an NTFS Alternate Data Stream). When a plugin DLL is blocked in this way, Windows prevents it from loading.

Previously, blocked plugin DLLs failed silently in MP, producing no error message. This led to significant user confusion and multiple support issues, especially when custom plugins were distributed to end users.

This change adds a check for the presence of a Zone Identifier = Internet on plugin DLLs. If a DLL is blocked, MP now displays a clear error message informing the user of the issue and how to resolve it.

For security reasons, the application does not attempt to remove the Zone Identifier automatically. The DLL must be manually unblocked by the user via the file’s Properties dialog.

@meee1
Copy link
Copy Markdown
Collaborator

meee1 commented Jan 14, 2026

only issue is this is not other OS friendly

@meee1
Copy link
Copy Markdown
Collaborator

meee1 commented Jan 14, 2026

does File.Exists work?

@EosBandi
Copy link
Copy Markdown
Collaborator Author

Unfortunately in .net4.7 alternative data streams are not recognized, so it needs system calls.

To check if we are on Windows isn't the
if (!Program.MONO) //Only on Windows
do the trick ?

@meee1
Copy link
Copy Markdown
Collaborator

meee1 commented Jan 14, 2026

Can we do the inverse? If we know it's windows do the pinvokes, else skip. Ie positive detection.

I'm just thinking ahead as mono is getting limited.

@meee1 meee1 requested a review from Copilot March 16, 2026 11:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants